<template>
	<view class="pagebox">
		<view class="doctorbox">
			<view class="imgbox">
				<image :src="'https://changban.dianjingkeji.net/prod-api'+pro.dAvatarUrl" mode=""></image>
			<!-- 	<image :src="'http://192.168.10.93:8989'+pro.davatarUrl" mode=""></image> -->
			</view>
			<view class="infobox">
				<view class="nameline">
					<view class="name">
					{{pro.dName}}
					</view>
					<view class="keshi">
						{{pro.dKeshi}}
					</view>
				</view>
				<view class="homeleftrail">
				{{pro.orgName}}
				</view>
				<view class="zhichengline">
					<view class="itemzhicheng">
						{{pro.dZhicheng}}
					</view>
				</view>
			</view>
		</view>
		<view class="listbox">
<!-- 			<view class="itemlist">
				<view class="titleline">
					<view class="iconfont icon-weixin1">
						
					</view>
					<view class="name">
						图文咨询
					</view>
					<view class="label">
						医生亲自回复
					</view>
					<view class="price">
						￥200/小时
					</view>
				</view>
				<view class="label">
					医生临床工作繁忙，会在休息时间查看并回复问题，适合非紧急健康咨询
				</view>
				<view class="btnline">
					<view class="itemtitle">
						48小时内不限次
					</view>
					<view class="itembtn">
						立即购买
					</view>
				</view>
			</view> -->
			<view class="itemlist">
				<view class="titleline">
					<view class="iconfont icon-tianjia">
						
					</view>
					<view class="name">
						专病服务
					</view>
					<view class="label">
						个性化方案
					</view>
					<view class="price">
						
					</view>
				</view>
				<view class="label">
					主任医师团队，针对性管理服务三个月。
				</view>
				<view class="btnline">
					<view class="itemtitle">
						48小时内不限次
					</view>
					<view class="itembtn" @click="zhuanbing">
						查看详情
					</view>
				</view>
			</view>
			<view class="itemlist">
				<view class="titleline">
					<view class="iconfont icon-tuandui">
						
					</view>
					<view class="name">
						健康管理
					</view>
					<view class="label">
						6x团队
					</view>
					<view class="price">
						
					</view>
				</view>
				<view class="label">
					智能体提供健康管理服务，定期跟踪病情，风险异常实时上报医生干预
				</view>
				<view class="btnline">
					<view class="itemtitle">
						48小时内不限次
					</view>
					<view class="itembtn" @click="huiyuan">
						查看详情
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getdoctor,buyService} from '../../utils/api.js'
	export default {
		data() {
			return {
				pro:{},
				
			}
		},
		onLoad(e) {
			
			if(e.phone){
				uni.setStorageSync('tuiphone',e.phone)
			
			}else{
				if(e.dphone){
					this.phone=e.dphone
					let p={
						phone:e.dphone
					}
					getdoctor(p).then(res=>{
						console.log(res)
						this.pro=res.data.data
					})
				}
				
			} 
			
			
		},
		onShow() {
			if(uni.getStorageSync('tuiphone')){
				let p={
					phone:uni.getStorageSync('tuiphone')
				}
				getdoctor(p).then(res=>{
					console.log(res)
					this.pro=res.data.data
					if(res.data.code==200){
						let a={
							phone:uni.getStorageSync('phone'),
							doctorPhone:uni.getStorageSync('tuiphone')
						}
						buyService(a).then(res=>{
							console.log(res)
							uni.clearStorageSync('tuiphone')
						})
					}
					
				})
				
			}
		},
		methods: {
			zhuanbing(){
				let did=this.pro.id
				uni.navigateTo({
					url:'/pagesB/zhuanbing/zhuanbing?id='+did
				})
			},
			huiyuan(){
				let did=this.pro.id
				uni.navigateTo({
					url:'/pagesB/vipfuwu/vipfuwu?id='+did
				})
			},
		}
	}
</script>

<style lang="less" scoped>
 .pagebox{
	 width: 750rpx;
	 box-sizing: border-box;
	 padding-bottom: 200rpx;
	background: linear-gradient(180deg, rgba(242,248,255,1) 0%,rgba(255,255,255,0) 76%);
	
	 .doctorbox{
	 		 width: 94%;
	 		 margin: auto;
	 		 display: flex;
	 		 align-items: center;
	 		 background-color: white;
	 		 box-sizing: border-box;
	 		 padding: 20rpx;
	 		 border-radius: 20rpx;
	 		 .imgbox{
	 		 						  width: 170rpx;
	 		 						  height: 200rpx;
	 		 						  border-radius: 10rpx;
	 		 						  margin-right: 20rpx;
	 		 						  image{
	 		 							  width: 100%;
	 		 							  height: 100%;
	 		 							  border-radius: 10rpx;
	 		 						  }
	 		 }
	 		 .infobox{
	 		 						flex: 1;
	 		 						line-height: 2.5;
	 		 						.nameline{
	 		 							display: flex;
	 		 							align-items: center;
	 		 							position: relative;
	 		 							.iconfont{
	 		 								position: absolute;
	 		 								right: 10rpx;
	 		 								top: 0;
	 		 								
	 		 							}
	 		 							.name{
	 		 								font-weight: bold;
	 		 								margin-right: 20rpx;
	 		 							}
	 		 						}
	 		 						.hospitalname{
	 		 							font-size: 24rpx;
	 		 							padding: 10rpx 30rpx;
	 		 							border-radius: 10rpx;
	 		 							background-color: #F4F4F4 ;
	 		 						}
	 		 						.zhichengline{
	 		 							display: flex;
	 		 							align-items: center;
	 		 							.itemzhicheng{
	 		 								font-size: 22rpx;
	 		 								color: #B16A00 ;
	 		 								background-color: #FFF6EB ;
	 		 								padding: 10rpx 30rpx;
	 		 									border-radius: 10rpx;
	 		 							}
	 		 							
	 		 						}
	 		 						
	 		 }
	 }
	 .listbox{
		 width: 100%;
		 box-sizing: border-box;
		 padding: 20rpx;
		 .itemlist{
			 width: 100%;
			 box-sizing: border-box;
			 padding: 20rpx;
			 background-color: white;
			 border-radius: 20rpx;
			 margin-top: 20rpx;
			 .titleline{
				 display: flex;
				 align-items: center;
				 line-height: 2;
				 justify-content: space-between;
				 .iconfont{
					 font-size: 44rpx;
					 color: #1a4f8a ;
					 margin-right: 20rpx;
				 }
				 .name{
					 font-weight: bold;
					 font-size: 34rpx;
				 }
				 .label{
					 color: #B16A00 ;
					 font-size: 24rpx;
					 background-color: #FFF6EB ;
					 padding: 4rpx 8rpx;
					 margin: 0 10rpx;
				 }
				 .price{
					 color: #FF8A00 ;
					 font-weight: bold;
				 }
			 }
			 .label{
				 line-height: 1.5;
			 }
			 .btnline{
				 width: 100%;
				 display: flex;
				 align-items: center;
				 justify-content: space-between;
				 margin-top: 20rpx;
				 .itemtitle{
					 font-size: 30rpx;
					 height: 50rpx;
					  padding: 16rpx 20rpx;
					 text-align: center;
					 line-height: 50rpx;
					 background-color: #F7F7F7;
					 border-radius: 10rpx;
				 }
				 .itembtn{
					 color: #1a4f8a ;
					background: linear-gradient(180deg,#f4f9ff 0%,rgba(243,232,253,1) 100%);
					 padding: 16rpx 20rpx;
					border-radius: 30rpx;
					font-weight: bold;
					font-size: 28rpx;
				 }
			 }
		 }
	 }
 }
</style>
